package com.example.basicdemo.controller;


import com.example.basicdemo.model.builder.*;
import com.example.basicdemo.model.domain.*;
import com.example.basicdemo.model.result.*;
import com.example.basicdemo.service.PermissionService;
import com.isyscore.os.dev.util.IsyscoreHashMap;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 该控制器集成了以下iSysCore OS的权限能力
 */
public class PermissionController {



    private static IsyscoreHashMap header = new IsyscoreHashMap();
    @Autowired
    private PermissionService permissionService;

    private void deleteRentalType() {
        //构建参数
        DeleteRentalTypeRequestBuilder builder = new DeleteRentalTypeRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        DeleteRentalTypeResult result = permissionService.deleteRentalType(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void updateRentalType() {
        //构建参数
        UpdateRentalTypeReqeustBuilder builder = new UpdateRentalTypeReqeustBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        UpdateRentalTypeResult result = permissionService.updateRentalType(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void addRentalType() {
        //构建参数
        AddRentalTypeRequestBuilder builder = new AddRentalTypeRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        AddRentalTypeResult result = permissionService.addRentalType(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void queryRentalType() {
        //构建参数
        QueryRentalTypeRequestBuilder builder = new QueryRentalTypeRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        QueryRentalTypeResult result = permissionService.queryRentalType(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void queryParkInfo() {
        //构建参数
        QueryParkInfoRequestBuilder builder = new QueryParkInfoRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        QueryParkInfoResult result = permissionService.queryParkInfo(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void deleteRentalInfo() {
        //构建参数
        DeleteRentalInfoRequestBuilder builder = new DeleteRentalInfoRequestBuilder()
                .setId(1)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        DeleteRentalInfoResult result = permissionService.deleteRentalInfo(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void switchRentalStatus() {
        //构建参数
        SwitchRentalStatusRequestBuilder builder = new SwitchRentalStatusRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        SwitchRentalStatusResult result = permissionService.switchRentalStatus(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void updateRentalInfo() {
        RentalInfoDomain domain = new RentalInfoDomain();
        //构建参数
        UpdateRentalInfoRequestBuilder builder = new UpdateRentalInfoRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        UpdateRentalInfoResult result = permissionService.updateRentalInfo(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void saveRentalInfo() {
        RentalInfoDomain domain = new RentalInfoDomain();
        //构建参数
        SaveRentalInfoRequestBuilder builder = new SaveRentalInfoRequestBuilder();
//                .setUserName("123")
//                .setPhone("15372410842")
//                .setBizDomain(domain)
//                //设置请求头
//                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        SaveRentalInfoResult result = permissionService.saveRentalInfo(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void getRentalChild() {
        //构建参数
        GetRentalChildRequestBuilder builder = new GetRentalChildRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        GetRentalChildResult result = permissionService.getRentalChild(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }


    private void queryRentalInfoChild() {
        //构建参数
        QueryRentalInfoChildRequestBuilder builder = new QueryRentalInfoChildRequestBuilder()
                //设置请求头
                .setHeaders(header);
//                .setRentalId(1);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        QueryRentalInfoChildResult result = permissionService.queryRentalInfoChild(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    private void queryRentalInfoDetail() {
        //构建参数
        QueryRentalInfoDetailRequestBuilder builder = new QueryRentalInfoDetailRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        QueryRentalInfoDetailResult result = permissionService.queryRentalInfoDetail(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }


    private void queryRentalInfo() {
        //构建参数
        QueryRentalInfoRequestBuilder builder = new QueryRentalInfoRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        QueryRentalInfoResult result = permissionService.queryRentalInfo(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 查询用户权限
     */
    public void queryUserAcl() {
        //构建参数
        QueryUserAclRequestBuilder builder = new QueryUserAclRequestBuilder()
                //设置应用code: 指查询指定应用下的用户权限
                .setAppCode("sysmanage")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        QueryUserAclResult result = permissionService.queryUserAcl(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }


    /**
     * 用户列表分页
     */
    public void pageUser() {
        //构建参数
        PageUserDomain bizModel = new PageUserDomain();
        bizModel.setPageNo(1);
//        bizModel.setUserName(null);
        //设置用户名
//        bizModel.setUserName("");
//        //设置数据角色名
//        bizModel.setAuthName("");
//        //设置功能角色名
//        bizModel.setRoleName("");
//        //设置手机号
//        bizModel.setTelePhone("");
//        bizModel.setPageNo(1);
//        bizModel.setPageSize(15);
        PageUserRequestBuilder builder = new PageUserRequestBuilder()
                .setBizModel(bizModel)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        PageUserResult result = permissionService.pageUser(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }


    /**
     * 查询功能角色列表
     */
    public void listRoleAcl() {

        //构建参数
        ListRoleAclRequestBuilder builder = new ListRoleAclRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        ListRoleAclResult result = permissionService.listRoleAcl(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseListData());
    }

    /**
     * 单点登录
     */
    public void osLogin() {
        //构建参数
        OsLoginRequestBuilder builder = new OsLoginRequestBuilder()
                //设置用户名
//                .setUsername("admin")
                //设置密码
//                .setPassword("admin")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //接口函数调用
        OsLoginResult result = permissionService.osLogin(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 账号状态
     */
    public void osLoginStatus() {
        //构建参数
        OsLoginStatusRequestBuilder builder = new OsLoginStatusRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        OsLoginStatusResult result = permissionService.osLoginStatus(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 退出登录
     */
    public void osLogout() {
        //构建参数
        OsLogoutRequestBuilder builder = new OsLogoutRequestBuilder()
//                .setToken("2181688a-0a00-4753-9048-7d6451b952c8")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        OsLogoutResult result = permissionService.osLogout(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }


    /**
     * 根据角色ID查询功能权限
     */
    public void queryRoleAclById() {
        QueryRoleAclByIdRequestBuilder builder = new QueryRoleAclByIdRequestBuilder()
                //设置角色ID
                .setRoleId("123")
                //设置应用code
                .setAppCode("appCode")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        QueryRoleAclByIdResult result = permissionService.queryRoleAclById(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 查询角色权限列表分页
     */
    public void queryRoleAcl() {
        //构建参数
        SysRoleDomain bizModel = new SysRoleDomain();
        //设置应用code
        bizModel.setAppCodes("appCode");
        //设置角色名称
        bizModel.setName("name");
        bizModel.setPageNo(1);
        bizModel.setPageSize(15);
        QueryRoleAclRequestBuilder builder = new QueryRoleAclRequestBuilder()
                .setBizModel(bizModel)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        QueryRoleAclResult result = permissionService.queryRoleAcl(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 序号查询用户
     */
    public void queryUserById() {
        //构建参数
        QueryUserByIdRequestBuilder builder = new QueryUserByIdRequestBuilder()
//                .setUuid("123")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        QueryUserByIdResult result = permissionService.queryUserById(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 重置密码
     */
    public void resetPassword() {
        //构建参数
        ResetPasswordRequestBuilder builder = new ResetPasswordRequestBuilder()
                .setPhoneNumber("18888888888")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        ResetPasswordResult result = permissionService.resetPassword(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 新增角色权限
     */
    public void saveRoleAcl() {
        //构建参数
        RoleParamDomain bizModel = new RoleParamDomain();
        //设置角色名称
        bizModel.setName("nametest1");
        //设置角色权限
//        bizModel.setAcls("{}");
        //设置角色备注
        bizModel.setRemark("remark");
//        bizModel.setType(1);
//        bizModel.setStatus(1);
        SaveRoleAclRequestBuilder builder = new SaveRoleAclRequestBuilder()
                .setBizModel(bizModel)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        SaveRoleAclResult result = permissionService.saveRoleAcl(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 新增账户
     */
    public void saveUser() {

        //构建参数
        SysUserLDAPDomain bizModel = new SysUserLDAPDomain();
        //TODO
        //设置密码
        bizModel.setPassword("password");
        SaveUserRequestBuilder builder = new SaveUserRequestBuilder()
                .setBizModel(bizModel)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        SaveUserResult result = permissionService.saveUser(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 修改角色权限
     */
    public void updateRoleAcl() {
        //构建参数
        RoleParamDomain bizModel = new RoleParamDomain();
        //设置角色ID
//        bizModel.setId(1);
        //设置角色名称
//        bizModel.setName("name");
        //设置角色权限
//        bizModel.setAcls("{}}");
        //设置角色权限备注
        bizModel.setRemark("remark");
        UpdateRoleAclRequestBuilder builder = new UpdateRoleAclRequestBuilder()
                .setBizModel(bizModel)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        UpdateRoleAclResult result = permissionService.updateRoleAcl(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 修改密码
     */
    public void updateUserPassword() {
        //构建参数
        UpdateUserPasswordRequestBuilder builder = new UpdateUserPasswordRequestBuilder()
                .setPassword("password")
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        UpdateUserPasswordResult result = permissionService.updateUserPassword(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 修改账户
     */
    public void updateUser() {
        //构建参数
        SysUserLDAPDomain bizModel = new SysUserLDAPDomain();
        //TODO  设置用户ID
//        bizModel.setUuid("1237221285990371328");
//        //设置用户名称
//        bizModel.setUserName("username1");
//        //设置手机号
//        bizModel.setTelePhone("18888888888");
//        //设置生日日期, 格式:
//        bizModel.setBirthDay("2019-12-30");
//        //设置数据权限ID
//        bizModel.setAuthId("1");
//        //设置部门ID
//        bizModel.setDeptId("1");
//        //设置学历ID
//        bizModel.setDegreeId("1");
//        //设置人脸照片URL
//        bizModel.setFacePhoto("http://facephoto.url");
//        //设置角色ID
//        bizModel.setRoleId("1");
//        //设置性别ID
//        bizModel.setSexId("1");

        UpdateUserRequestBuilder builder = new UpdateUserRequestBuilder()
                .setBizModel(bizModel)
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        UpdateUserResult result = permissionService.updateUser(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }


    /**
     * 获取所有学历
     */
    public void getAllDegree() {

        GetAllDegreeRequestBuilder builder = new GetAllDegreeRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        GetAllDegreeResult result = permissionService.getAllDegree(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }

    /**
     * 获取所有公司
     */
    public void getAllLdapDept() {

        GetAllLdapDeptRequestBuilder builder = new GetAllLdapDeptRequestBuilder()
                //设置请求头
                .setHeaders(header);
        //根据request设置请求头
        //.setRequestHeader(request);

        //调用接口函数
        GetAllLdapDeptResult result = permissionService.getAllLdapDept(builder);
        //判断结果是否成功
        System.out.println("success: " + result.isSuccess());
        //获取httpCode:http请求结果的code码
        System.out.println("httpCode: " + result.getResponse().getHttpCode());
        //获取httpMessage:http请求结果的消息
        System.out.println("httpMessage: " + result.getResponse().getHttpMessage());
        //获取code:接口返回的错误码
        System.out.println("code: " + result.getResponse().getCode());
        //获取message:接口返回的错误消息
        System.out.println("message: " + result.getResponse().getMessage());
        //获取detail:接口返回的错误附带详情
        System.out.println("detail: " + result.getResponse().getDetail());
        //获取结果数据
        System.out.println("body: " + result.getResponse().getBody());
        //解析结果数据(Json 转 Object)
        System.out.println("parseData: " + result.parseData());
    }
}
